<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="modal-dialog ms-modal-dialog" style="width: 600px;">
  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">查询车辆</h4>
    </div>

    <form method="GET" action="${ctx.host}/vehicle-sources" class="form-horizontal ms-form modal-search-form" role="form" data-validate="true">
    
      <input type="hidden" name="filter" value="true" />
      <input type="hidden" name="status" value="${status}" />

      <div class="modal-body">
      
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-4">
            <span>牵引车中文车牌号组：</span><br/>
            <span class="text-red">（以英文 ", " 逗号隔开）</span>
          </label>
          <div class="col-xs-7 pull-left">
            <textarea name="tractorBrandCodes" rows="3" cols="41"></textarea>
          </div>
        </div>

        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-4">牵引车中文车牌号：</label>
          <div class="col-xs-7 pull-left">
            <input type="text" class="form-control" name="tractorBrandCode" placeholder="牵引车中文车牌号" tabindex="1" autocomplete="off"/>
          </div>
        </div>

        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-4">挂车中文车牌号：</label>
          <div class="col-xs-7 pull-left">
            <input type="text" class="form-control" name="trailerBrandCode" placeholder="挂车中文车牌号" tabindex="2" autocomplete="off"/>
          </div>
        </div>
        
        <div class="form-group  ms-form-group">
          <label class="control-label col-xs-4">是否锁定：</label>
          <div class="col-xs-7">
            <select name="lock" class="select2 form-control" tabindex="4">
              <option></option>
              <option value="true">是</option>
              <option value="false">否</option>
            </select>
          </div>
        </div>
        
        <c:if test="${status.synced}">
	        <div class="form-group  ms-form-group">
	          <label class="control-label col-xs-4">是否已绑定司机：</label>
	          <div class="col-xs-7">
	            <select name="bind" class="select2 form-control" tabindex="4">
	              <option></option>
	              <option value="true">是</option>
	              <option value="false">否</option>
	            </select>
	          </div>
	        </div>
        </c:if>
        
      </div>

      <div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn ms-btn btn-primary">查询</button>
        <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
      </div>

    </form>
  </div>
  
</div>

<script>
	$(document).ready(function(){
	  
	  $('select[name="lock"]').select2({
      theme: "classic",
      placeholder : '请选择',
      minimumResultsForSearch : -1,
      allowClear : true,
    });
	  
	  $('select[name="bind"]').select2({
	    theme: "classic",
	    placeholder : '请选择',
	    minimumResultsForSearch : -1,
	    allowClear : true,
	  });
	  
	})
</script>  